package com.example.zjx8969.myapplication;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;


/**
 * Created by hawk.zheng on 2016/4/16.
 */
public class GsonAgent {
    public Gson gson;

    private GsonAgent() {
        GsonBuilder gsonBuilder = new GsonBuilder()
                .registerTypeAdapter(String.class, new JsonStringReader())
 ;


        gson = gsonBuilder.create();
    }

    public static GsonAgent getInstance() {
        return GsonHolder.gsonAgent;
    }

    private static class GsonHolder {
        private static GsonAgent gsonAgent = new GsonAgent();
    }
}
